package cn.edu.sdjzu.xg.eagle.test;

import cn.edu.sdjzu.xg.eagle.entity.Pagination;
import cn.edu.sdjzu.xg.eagle.util.TxtHelper;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSON;
import java.io.IOException;

public class test1 {
    public static void main(String[] args) throws IOException {
        String json_obj_str = TxtHelper.readTxt("E:\\JW202302104056\\.idea\\files\\paginationObject.txt");
        JSONObject pagination_json_obj = JSONObject.parseObject(json_obj_str);
        Object pageSize_obj = pagination_json_obj.get("pageSize");
        Object pageNum_obj = pagination_json_obj.get("pageNo");
        System.out.println(pageSize_obj);
        System.out.println(pageNum_obj);

        Pagination pagination2 = JSON.parseObject(json_obj_str,Pagination.class);
        int pageNo2 = pagination2.getPageNo();
        int pageSize2 = pagination2.getPageSize();
        System.out.println(pageNo2);
        System.out.println(pageSize2);


    }
}
